home *** CD-ROM | disk | FTP | other *** search
/ Mission 3 / Mission 3.zip / Mission 3.iso / spiele / sac / manual / chapter6.doc < prev   
Text File  |  2012-11-26  |  8KB  |  246 lines

  1.                            Chapter 6
  2.                   Writing an adventure game
  3.  ****************************************************************** 
  4.  
  5.  In this final chapter I am going to show you how to write a full
  6.  adventure game called Witches Castle.
  7.  
  8.  The story goes like this... The wicked witch has kidnapped the 
  9.  princess and is holding her captive in the castle. A warrior has 
  10.  been charged with the task of defeating the witch and rescuing 
  11.  the princess then leaving the castle.
  12.  
  13.  So we have the plot and the main character, so we shall define a 
  14.  game world which is the castle. Lets make a note of the locations 
  15.  we would find in a castle, the list would look like this...
  16.  
  17.  Castle entrance
  18.  Main hall
  19.  Dungeon
  20.  Throne room
  21.  Musty room
  22.  
  23.  Of course, a castle would have more locations than this but I'm 
  24.  just keeping it short and simple. Now lets add two more.
  25.  
  26.  Lake
  27.  Enchanted Forest
  28.  
  29.  In this game the player would start at the castle entrance and 
  30.  these two locations can be on either side of him while the castle 
  31.  is in front of him.
  32.  
  33.  Now we need some objects which are as followed..
  34.  
  35.  A steel key..... used to unlock the dungeon door
  36.  An axe....... To kill the rat
  37.  Guards uniform... Has to be worn to get pass the guards
  38.  A Goblet... Contains holy water which kills the witch
  39.   
  40.  Now we've worked this out, we can enter the information into Sac.
  41.  
  42.  Load the creator, go to the location menu and insert the 
  43.  following seven locations.
  44.  
  45.   Location 1
  46.  
  47.   You stand before the mighty castle which is north. On the top of 
  48.   it is a ugly stone gargoyle whose stare sends a shiver up your 
  49.   spine. You can also go west and east.
  50.  
  51.   Location 2
  52.  
  53.   You are beside a beautiful lake which glimmers under the morning 
  54.   sun. It is surrounded by clusters of trees and bushes which glow 
  55.   brightly. You can only go east.
  56.  
  57.   Location 3
  58.  
  59.   You find yourself in the Enchanted Forest which is dark and 
  60.   creepy. The trees and bushes have no beauty and make further 
  61.   movement impossible except west.
  62.  
  63.   Location 4
  64.  
  65.   The main hall of the castle. It has a certain mist of evil about 
  66.   it and full of old junk. To the east stands an arched doorway 
  67.   and west a dungeon. You can also go north and south.
  68.  
  69.   Location 5
  70.  
  71.   You find yourself outside the castle dungeon and all you see is 
  72.   a large steel door. The hall is east.
  73.  
  74.   Location 6
  75.  
  76.   Emerging into the Throne Room you see nothing but murkey cobwebs 
  77.   and a small steel throne. You can see a large cauldron and an 
  78.   arched doorway leading west.
  79.  
  80.   Location 7
  81.  
  82.   You are in a bare musty room. A doorway is south.
  83.  
  84.  Now go to the connection definer and insert these connections.
  85.  
  86.   Location 1
  87.  
  88.   West to location 2, East to location 3
  89.  
  90.   Location 2
  91.  
  92.   East to location 1
  93.  
  94.   Location 3
  95.  
  96.   West to location 1
  97.  
  98.   Location 4
  99.  
  100.   South to location 1, West to location 5, East to location 6
  101.   North to location 7
  102.  
  103.   Location 5
  104.  
  105.   East to location 4
  106.  
  107.   Location 6
  108.  
  109.   West to location 4
  110.  
  111.   Location 7
  112.  
  113.   South to location 4
  114.  
  115.  Now enter the objects in the object definer along with their 
  116.  locations and object words.
  117.  
  118.   Object 1...a steel key., location (not created), key
  119.   Object 2...an axe., location 3, axe
  120.   Object 3...a guards uniform., location 2, uniform
  121.   Object 4...a goblet., location (not created),goblet
  122.  
  123.  Go straight to the Message definer (m) and enter these messages.
  124.  
  125.   Message 1
  126.  
  127.   The water melts the witch into nothing and drops the key.
  128.  
  129.   Message 2
  130.  
  131.   As you are wearing the uniform, the guards lower the drawbridge 
  132.   to let you in.
  133.  
  134.   Message 3
  135.  
  136.   You kill the rat and a goblet of holy water appears.
  137.  
  138.   Message 4
  139.  
  140.   The witch is here, she is holding a steel key.
  141.  
  142.   Message 5
  143.  
  144.   You unlock the door and the princess runs out and gives you a 
  145.   big hug then says C'mon lets leave this castle.
  146.  
  147.   Message 6
  148.  
  149.   There is a vicious rat here.
  150.  
  151.   Message 7
  152.  
  153.   The princess is here.
  154.  
  155.   Message 8
  156.  
  157.   Well done, you have rescued the princess and completed your task.
  158.  
  159.   Message 9
  160.  
  161.   The guards refuse to let you in the castle.
  162.  
  163.  If you wish, you can add some examine messages to the game, this 
  164.  involves four messages in the Examine Object option and as many 
  165.  as you want in the Examine Location option.
  166.  
  167.  Now we have all the data we need for now, if you wish to add more 
  168.  later you can always load it back in.
  169.  
  170.  Now save your data file, load Stos, and load the Editor program.
  171.  
  172.  As you may have guessed we have a rat and a witch in the game as 
  173.  well as a princess so lets define them as varibles.
  174.  
  175.   WITCH=1 : PRINCESS=0 : RAT=1
  176.  
  177.   So at this moment the witch and rat are alive and the princess 
  178.   is not yet rescued. Add this lines as H_P events
  179.  
  180.   if LOC=1 and OB_LOC(3)<>W0RN then print MESSAGE$(9)
  181.   if LOC=1 and OB_LOC(3)=W0RN then print MESSAGE$(2) : MAP(1,1)=4
  182.   if LOC=6 and WITCH=1 then print MESSAGE$(4)
  183.   if LOC=7 and RAT=1 then print MESSAGE$(6)
  184.   if MEET=1 then PRINCESS=LOC : print MESSAGE$(7)
  185.   if LOC=1 and PRINCESS=LOC then print MESSAGE$(8) : goto 2610
  186.  
  187.  The first event tells Stos that if the player is not wearing the 
  188.  uniform the guards won't let him in and the second event tells 
  189.  Stos that the guards will let him in because he's wearing the 
  190.  uniform. The varible W0RN holds the location of worn objects which 
  191.  is 1000. Now add these L_P events.
  192.  
  193.   If WRD$(1)="throw" and WRD$(2)="goblet" and OB_LOC(4)=CARRIED 
  194.   then OB_LOC(4)=NC : OB_LOC(1)=LOC : print MESSAGE$(1) : NO=1 : 
  195.   WRD$(1)="" : WRD$(2)="" : WITCH=0 : DONE=1
  196.  
  197.  So when the goblet is throw, it vanishes to the not created 
  198.  location and the key is created at put at the players location.
  199.  
  200.   If WRD$(1)="kill" and WRD$(2)="rat" and OB_LOC(2)=CARRIED then 
  201.   RAT=0 : OB_LOC(4)=LOC : print MESSAGE$(3) : NO=1 : WRD$(1)="" : 
  202.   WRD$(2)="" : DONE=1
  203.  
  204.  This line kills the rat and creates the goblet.
  205.  
  206.   If WRD$(1)="unlock" and WRD$(2)="door" and OB_LOC(1)=CARRIED 
  207.   then print MESSAGE$(5) : MEET=1 : NO=1 : WRD$(1)="" : WRD$(2)="" 
  208.   : DONE=1
  209.  
  210.  This line rescues the princess.
  211.     
  212.   Well..... thats it, the game is finished, all you have to do is 
  213.   change the loading name from 'game.var' to the one you choose 
  214.   when you saved the data from the creator. Give it a test run and 
  215.   correct any mistakes you find, when your sure it works okay then 
  216.   why not add a few extras like samples, music and graphics. You 
  217.   can then save it as a run only program, many even compile it and 
  218.   give it to all your friends.
  219.  
  220.  As you can see, you have just written a full adventure game in 
  221.  just one day, with more practise you could write large more 
  222.  complex games with Sac and give them away if you wish.
  223.  
  224.  Before I go, I will give you one last example of how the player 
  225.  can fight monsters which can take more than one hit.
  226.  
  227.  Lets say the player can take 10 hits and the monster can take 5, 
  228.  all you have to do is set and name two varibles.
  229.  
  230.  MONSTER=5 : PLAYER=10
  231.  
  232.  Then using the method described in chapter 5, use a L_P event to 
  233.  take a point from each varible every time then use an H_P in the 
  234.  L_P section to check if any of the varibles equal 0 and if so, 
  235.  use a message to tell the player that either he or the monster is 
  236.  dead and either end the game or give him some points.
  237.  
  238.  Well thats the end of this manual, I hope you've enjoyed using 
  239.  Sac as much as I've enjoyed writing it and I hope to see any 
  240.  games you write with it.
  241.  
  242.  So what are you waiting for... get creating
  243.  
  244.   Have fun...........Deano
  245.    
  246.